<?php if(!defined('IN_KKFRAME')) exit('Access Denied'); ?>
<?php include template('header'); ?>
	<div class="container">
		<ul class="breadcrumb">
			<li><a href="./"><i class="icon-home"></i></a> <span class="divider">/</span></li>
			<li class="active">搜索结果</li>
		</ul>
		<div class="row-fluid">
			<div class="span12">
				<table class="table table-striped hidden-phone">
					<thead>
						<th>标题</th>
						<th>艺术家</th>
						<th>专辑</th>
						<th>UP主</th>
						<th>操作</th>
					</thead>
					<tbody>
					<?php if($songs){ ?>
						<?php foreach($songs as $song){ ?>
						<tr>
							<td>
								<?php echo $song['title']; ?>
								<?php if($song['type']=='1'){ ?><span class="badge"><?php if(getSetting('quality_1')){ echo getSetting('quality_1'); }else{ ?>渣音质<?php } ?></span>
								<?php }elseif($song['type']=='2'){ ?><span class="badge badge-success"><?php if(getSetting('quality_2')){ echo getSetting('quality_2'); }else{ ?>高音质<?php } ?></span>
								<?php }elseif($song['type']=='3'){ ?><span class="badge badge-info"><?php if(getSetting('quality_3')){ echo getSetting('quality_3'); }else{ ?>无损<?php } ?></span>
								<?php }else{ ?><span class="badge badge-inverse">未知</span><?php } ?>
							</td>
							<td><?php echo $song['artist']; ?></td>
							<td><?php echo $song['album']; ?></td>
							<td><img src="https://www.gravatar.com/avatar/<?php echo md5(trim(get_email($song['uid']))); ?>?s=20"></img>&nbsp;<?php echo get_username($song['uid']); ?></td>
							<td>
								<?php if($song['type']!='3'){ ?>
									<a class="btn btn-mini btn-primary" onclick="prompt('歌曲 <?php echo $song['title']; ?> 的外链:', '<?php echo $_config['siteurl']; ?>/file/link/<?php echo $song['uid']; ?>/<?php echo $song['id']; ?>.mp3');">外链</a>
									<a class="btn btn-mini btn-success" onclick="window.open('play.swf?src=<?php echo $_config['siteurl']; ?>/file/link/<?php echo $song['uid']; ?>/<?php echo $song['id']; ?>.mp3&auto_play=true','newwindow','height=400,width=700,top=200,left=200,toolbar=no,menubar=no,scrollbars=no, resizable=no,location=no, status=no')">试听</a>
								<?php } ?>
								<?php if(!getSetting('block_download')){ ?><a class="btn btn-mini" href="file/link/<?php echo $uid; ?>/<?php echo $song['id']; ?>.mp3" target="_blank">下载</a><?php } ?>
							</td>
						</tr>
						<?php } ?>
					<?php }else{ ?>
						<td colspan="5">没有查询到数据</td>
					<?php } ?>
					</tbody>
				</table>
				<div class="visible-phone">
					<?php if($songs){ ?>
						<?php foreach($songs as $song){ ?>
						<div id="song-<?php echo $song['id']; ?>">
							<h5><?php echo $song['title']; ?>&nbsp;<small><?php echo $song['artist']; ?></small></h5>
							<p>来自专辑：<?php echo $song['album']; ?></p>
							<p>UP主：<img src="https://www.gravatar.com/avatar/<?php echo md5(trim(get_email($song['uid']))); ?>?s=20"></img>&nbsp;<?php echo get_username($song['uid']); ?></p>
							<p>音质：
								<?php if($song['type']=='1'){ ?><span class="badge"><?php if(getSetting('quality_1')){ echo getSetting('quality_1'); }else{ ?>渣音质<?php } ?></span>
								<?php }elseif($song['type']=='2'){ ?><span class="badge badge-success"><?php if(getSetting('quality_2')){ echo getSetting('quality_2'); }else{ ?>高音质<?php } ?></span>
								<?php }elseif($song['type']=='3'){ ?><span class="badge badge-info"><?php if(getSetting('quality_3')){ echo getSetting('quality_3'); }else{ ?>无损<?php } ?></span>
								<?php }else{ ?><span class="badge badge-inverse">未知</span><?php } ?>
							</p>
							<p>
								<?php if($song['type']!='3'){ ?>
									<a class="btn btn-mini btn-primary" onclick="prompt('歌曲 <?php echo $song['title']; ?> 的外链:', '<?php echo $_config['siteurl']; ?>/file/link/<?php echo $uid; ?>/<?php echo $song['id']; ?>.mp3');">外链</a>
									<a class="btn btn-mini btn-success" target="_blank" href="html5player.php?name=<?php echo $song['title']; ?>&src=<?php echo $_config['siteurl']; ?>/file/link/<?php echo $uid; ?>/<?php echo $song['id']; ?>.mp3">试听</a>
								<?php } ?>
								<?php if(!getSetting('block_download')){ ?><a class="btn btn-mini" href="file/link/<?php echo $uid; ?>/<?php echo $song['id']; ?>.mp3" target="_blank">下载</a><?php } ?>
							</p>
						</div>
						<hr>
						<?php } ?>
					<?php }else{ ?>
						<div class="alert alert-info"><strong>提示</strong> 没有查询到数据</div>
					<?php } ?>
				</div>
				<div class="text-right"><?php echo $Page->show(); ?></div>
			</div>
		</div>
	</div>
<?php include template('footer'); ?>